home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / plain C OS8 / AMReminder / Dispatcher.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-29  |  3.4 KB  |  209 lines  |  [TEXT/CWIE]

  1. /* Dispatcher.c */
  2.  
  3. #include <Types.h>
  4. #include <Quickdraw.h>
  5. #include <Controls.h>
  6. #include <Dialogs.h>
  7. #include <Events.h>
  8. #include <Lists.h>
  9. #include <Menus.h>
  10. #include <TextEdit.h>
  11.  
  12. #include "AMReminderApp.h"
  13. #include "AMReminderDoc.h"
  14. #include "AMReminderEngine.h"
  15. #include "MainWindow.h"
  16. #include "Add.h"
  17.  
  18. #include "Globals.h"
  19. #include "Dispatcher.h"
  20.  
  21. /*----------*/
  22. void DoIdle (void)
  23. {
  24. }
  25.  
  26. //----------
  27. // windows
  28.  
  29. //----------
  30. void    Close (
  31.     AMWindow*        window)
  32. {
  33.     switch (GetClassID (window)) {
  34.     case classMainWindow:
  35.             MainWindow_Close ((MainWindow*) window);
  36.         break;
  37.     } // switch
  38. }
  39.  
  40. //----------
  41. void    DoTrack (
  42.     AMWindow*        window,
  43.     ControlHandle    whichControl,
  44.     short             whichPart,
  45.     Point            where)
  46. {
  47.     switch (GetClassID (window)) {
  48.     case classMainWindow:
  49.             MainWindow_Track ((MainWindow*) window, whichControl, whichPart, where);
  50.         break;
  51.     } // switch
  52. }
  53.  
  54. //----------
  55. void    MouseIn (
  56.     AMWindow*        window,
  57.     Point            where,
  58.     short            modifiers)
  59. {
  60.     switch (GetClassID (window)) {
  61.     case classMainWindow:
  62.             MainWindow_MouseIn ((MainWindow*) window, where, modifiers);
  63.         break;
  64.     } // switch
  65. }
  66.  
  67. //----------
  68. void    TypeIn (
  69.     AMWindow*        window,
  70.     char            ch)
  71. {
  72.     switch (GetClassID (window)) {
  73.     case classMainWindow:
  74.             MainWindow_TypeIn ((MainWindow*) window, ch);
  75.         break;
  76.     } // switch
  77. }
  78.  
  79. //----------
  80. void    Resize (
  81.     AMWindow*        window)
  82. {
  83.     switch (GetClassID (window)) {
  84.     case classMainWindow:
  85.             MainWindow_Resize ((MainWindow*) window);
  86.         break;
  87.     } // switch
  88. }
  89.  
  90. //----------
  91. void    Scroll (
  92.     AMWindow*        window,
  93.     short            newValue,
  94.     short            oldValue)
  95. {
  96.     switch (GetClassID (window)) {
  97.     case classMainWindow:
  98.             MainWindow_Scroll ((MainWindow*) window, newValue, oldValue);
  99.         break;
  100.     } // switch
  101. }
  102.  
  103. //----------
  104. Boolean    DoCommand (
  105.     AMWindow*        window,
  106.     long            inCommand)
  107. {
  108.     switch (GetClassID (window)) {
  109.     case classMainWindow:
  110.             return MainWindow_DoCommand ((MainWindow*) window, inCommand);
  111.         break;
  112.     } // switch
  113.     return false;
  114. }
  115.  
  116. //----------
  117. void    ExitCurField (
  118.     AMWindow*        window)
  119. {
  120.     switch (GetClassID (window)) {
  121.     case classMainWindow:
  122.             MainWindow_ExitCurField ((MainWindow*) window);
  123.         break;
  124.     } // switch
  125. }
  126.  
  127. //----------
  128. void    DataChanged (
  129.     AMResponder*    responder,
  130.     long            inDataID)
  131. {
  132.     switch (GetClassID (responder)) {
  133.     case classMainWindow:
  134.             MainWindow_DataChanged ((MainWindow*) responder, inDataID);
  135.         break;
  136.     case classAdd:
  137.             Add_DataChanged ((Add*) responder, inDataID);
  138.         break;
  139.     } // switch
  140. }
  141.  
  142. //----------
  143. // dialogs
  144.  
  145. //----------
  146. void    FinishMake (
  147.     AMDialog*        dialog)
  148. {
  149.     switch (GetClassID (dialog)) {
  150.     case classAdd:
  151.             Add_FinishMake ((Add*) dialog);
  152.         break;
  153.     } // switch
  154. }
  155.  
  156. //----------
  157. void    ConnectToData (
  158.     AMDialog*        dialog,
  159.     AMSignaler*        inData)
  160. {
  161.     switch (GetClassID (dialog)) {
  162.     case classAdd:
  163.             Add_ConnectToData ((Add*) dialog, inData);
  164.         break;
  165.     } // switch
  166. }
  167.  
  168. //----------
  169. void    DoItem (
  170.     AMDialog*        dialog,
  171.     SInt16            inItemHit)
  172. {
  173.     switch (GetClassID (dialog)) {
  174.     case classAdd:
  175.             Add_DoItem ((Add*) dialog, inItemHit);
  176.         break;
  177.     } // switch
  178. }
  179.  
  180. //----------
  181. Boolean        Filter (
  182.     AMDialog*            dialog,
  183.     EventRecord            *ioEvent,
  184.     DialogItemIndex        *outItemHit)
  185. {
  186.     switch (GetClassID (dialog)) {
  187.     case classAdd:
  188.             return Add_Filter ((Add*) dialog, ioEvent, outItemHit);
  189.         break;
  190.     } // switch
  191.     return false;    // not filtered => Dialog Manager takes it
  192. }
  193.  
  194. //----------
  195. // modeless dialogs
  196.  
  197. /*----------*/
  198. void    InitModelessDialogs (void)
  199. {
  200.  
  201. }
  202.  
  203. /*----------*/
  204. void    CloseModelessDialog (
  205.     DialogPtr        whichDialog)
  206. {
  207.  
  208. }
  209.